package com.emcom.gotour.utils;

import java.io.Serializable;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

public class ColumeProperty implements Comparable<Object>, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -8643851226723898875L;
	private String columeName;
	private String columeType;
	private String propertyName;
	public String getColumeName() {
		return columeName;
	}
	public void setColumeName(String columeName) {
		this.columeName = columeName;
	}
	public String getColumeType() {
		return columeType;
	}
	public void setColumeType(String columeType) {
		this.columeType = columeType;
	}
	public String getPropertyName() {
		return propertyName;
	}
	public void setPropertyName(String propertyName) {
		this.propertyName = propertyName;
	}
	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		ColumeProperty myClass = (ColumeProperty) object;
		return new CompareToBuilder().append(this.propertyName,
				myClass.propertyName).append(this.columeName,
				myClass.columeName).append(this.columeType, myClass.columeType)
				.toComparison();
	}
	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof ColumeProperty)) {
			return false;
		}
		ColumeProperty rhs = (ColumeProperty) object;
		return new EqualsBuilder().appendSuper(super.equals(object)).append(
				this.propertyName, rhs.propertyName).append(this.columeName,
				rhs.columeName).append(this.columeType, rhs.columeType)
				.isEquals();
	}
	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(39036893, 1934916397).appendSuper(
				super.hashCode()).append(this.propertyName).append(
				this.columeName).append(this.columeType).toHashCode();
	}
	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this).append("propertyName",
				this.propertyName).append("columeName", this.columeName)
				.append("columeType", this.columeType).toString();
	}
}
